	<div class="post">
		<div class="post_header">
			<h2 class="post_title"><?php $this->title(); ?></h2>
			<div class="post_tab">
				<a rel="a" class="btn_detail on" href="#pro_detail">产品详情</a>
				<a rel="b" class="btn_pics" href="#pro_pictures">产品图集</a>
				<a rel="c" class="btn_comment" href="#pro_comment">产品评论</a>
				<a rel="d" class="btn_order" href="#pro_order">下订单</a>
			</div>
		</div>

		<?php 
			$attach = $this->db->fetchAll($this->db->select('text')->from('table.contents')->where('type = \'attachment\' AND parent = ?', $this->cid));
			if(!empty($attach)){
				$imgs = array();
				for($i=0; $i<count($attach); $i++){
					$attach_text = unserialize($attach[$i]['text']);
					$attach_title = $attach_text['name'];
					$attach_path = $attach_text['path'];
					$imgs[$i]['title'] = $attach_title;
					$imgs[$i]['preview'] = Typecho_Common::url($attach_path, $this->options->index);	//Typecho_Common::url(___PREVIEW___.$attach_path, $this->options->index);
					$imgs[$i]['src'] = Typecho_Common::url($attach_path, $this->options->index);		
				}
				$img_first = '<p><img id="pre_pic_btn" align="right" src="'.$imgs[0]['src'].'" title="'.$imgs[0]['title'].'" width="120" height="90" /></p>';
			}else{
				$img_first = '';
			}
		?>
		<div class="post_content post_div_a">
			<?php echo $img_first; $this->content(); ?>
		</div>

		<div class="post_pics post_div_b hide" id="post_pics">
		<?php
			//echo "\t\t<div class='post_pic_show'>";
			//echo "\t\t<img src='{$imgs[0]['src']}' alt='{$imgs[0]['title']}' title='{$imgs[0]['title']}'/>";
			//echo "\t</div>";
			if( !empty($imgs) ){
				foreach($imgs as $img){
					echo "\t\t\t<a href='{$img['src']}'><img data-title='{$img['title']}' src='{$img['preview']}' /></a>";
				}
			}
		?>
		</div>
		
		<div class="comment post_div_c hide">
			<?php $this->need('comments.php'); ?>
		</div>
		<?php  $_SESSION['order_token'] = md5('gendiao');
		?>
		<div class="pro_order post_div_d hide">
		<?php 
			/*
			Typecho_Widget::widget('Widget_Contents_Order_Related', 'parentId='.$this->cid)->to($order); 
			if( $order->have() ):
				echo '<ul style="text-align:left;">';
				while($order->next()): ?>
				<?php $text = unserialize($order->text); ?>
					<li>
					
					<?php echo $text['name'];?>, 
					<?php echo $text['tel'];?>,
					<?php echo $text['mail'];?>
					<?php _e('提交于'); ?></li>
				<?php endwhile; 
				echo '</ul>';
			endif;
			*/
		?>
			<p><label for="in_name">姓名：</label><input class="text" type="text" name="in_name" id="in_name" /></p>
			<p><label for="in_tel">电话：</label><input class="text" type="text" name="in_tel" id="in_tel" /></p>
			<p><label for="in_mail">邮箱：</label><input class="text" type="text" name="in_mail" id="in_mail" /></p>
			<p><label for="in_add">联系地址：</label><input class="text" type="text" name="in_add" id="in_add" /></p>
			<p><button id="in_submit_order">提交订单</button></p>
		</div>
	</div>
	